package com.demo.modules.log.controller;

import com.demo.common.core.domain.SysLogininforBo;
import com.demo.common.core.result.R;
import com.demo.common.core.utils.bean.BeanUtils;
import com.demo.common.datasource.web.controller.BaseController;
import com.demo.modules.log.domain.logininfor.SysLogininfor;
import com.demo.modules.log.service.ISysLogininforService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author MyPC
 */
@Api(tags = "A - 登录地址")
@RestController
@RequestMapping("/log")
public class SysLogininforController extends BaseController {

    @Autowired
    private ISysLogininforService iSysLogininforService;

    @ApiOperation("添加登录日志")
    @PostMapping("/logininfor")
    public R<Boolean> logininfor(SysLogininforBo sysLogininforBo) {
        return R.ok(iSysLogininforService.save(BeanUtils.copyDataProp(sysLogininforBo, new SysLogininfor())));
    }
}
